import request from "@/utils/request";
import { encryptionData } from "@/utils/com";
import Qs from "qs";
//   发布帮助中心
export function publishHelp(data) {
  return request({
    url: "/jcdSys/jcdHelpNotice/publishHelp",
    method: "post",
    headers: encryptionData(data, "/jcdHelpNotice/publishHelp"),
    data: Qs.stringify(data)
  });
}
//   删除帮助中心
export function deleteHelp(id) {
  return request({
    url: `/jcdSys/jcdHelpNotice/deleteHelp/${id}`,
    method: "DELETE",
    headers: encryptionData({}, `/jcdHelpNotice/deleteHelp/${id}`)
  });
}
//   添加帮助中心问题
export function helpAdd(data) {
  return request({
    url: "/jcdSys/jcdHelpNotice/helpAdd",
    method: "post",
    headers: encryptionData(data, "/jcdHelpNotice/helpAdd"),
    data: Qs.stringify(data)
  });
}
//   修改帮助中心问题
export function editHelp(data) {
  return request({
    url: "/jcdSys/jcdHelpNotice/editHelp",
    method: "put",
    headers: encryptionData(data, "/jcdHelpNotice/editHelp"),
    data: Qs.stringify(data)
  });
}
// 帮助中心列表查询
export function helpPage(data) {
  return request({
    url: "/jcdSys/jcdHelpNotice/helpPage",
    method: "get",
    headers: encryptionData(data, "/jcdHelpNotice/helpPage"),
    params: data
  });
}
// 费用及系数-获取
export function getCoefficient(data) {
  return request({
    url: "/jcdSys/jcdCostCoefficientSetting/getInfo",
    method: "get",
    headers: encryptionData(data, "/jcdCostCoefficientSetting/getInfo"),
    params: data
  });
}
// 费用及系数-保存
export function saveCoefficient(data) {
  return request({
    url: "/jcdSys/jcdCostCoefficientSetting/save",
    method: "post",
    headers: encryptionData(data, "/jcdCostCoefficientSetting/save"),
    data: Qs.stringify(data)
  });
}

// 费用及系数-服务订单设置-获取
export function getServiceCoefficient(data) {
  return request({
    url: "/jcdSys/jcdServiceOrderSetting/get",
    method: "get",
    headers: encryptionData(data, "/jcdServiceOrderSetting/get"),
    params: data
  });
}
// 费用及系数-服务订单设置-保存
export function saveServiceCoefficient(data) {
  return request({
    url: "/jcdSys/jcdServiceOrderSetting/save",
    method: "post",
    headers: encryptionData(data, "/jcdServiceOrderSetting/save"),
    data: Qs.stringify(data)
  });
}

// app-info

/* 获取app信息列表 */
export function getAppInfoList(data) {
  return request({
    url: "/jcdSys/config/appConfigInfo",
    method: "get",
    headers: encryptionData(data, "/config/appConfigInfo"),
    params: data
  });
}

/* app信息-获取修改信息 */
export function getAppInfoDetail(data) {
  return request({
    url: "/jcdSys/config/update",
    method: "PUT",
    headers: encryptionData(data, "/config/update")
    // params: data
  });
}

/* app信息-修改 */
export function updateAppInfo(data) {
  return request({
    url: "/jcdGys/updateAppInfo",
    method: "post",
    headers: encryptionData(data, "/updateAppInfo"),
    data: Qs.stringify(data)
  });
}

// versions
/* 获取版本管理列表 */
export function getVersionsList(data) {
  return request({
    url: "/jcdSys/version/list",
    method: "get",
    headers: encryptionData(data, "/version/list"),
    params: data
  });
}

/* 版本管理-删除 */
export function deleteVersions(data, id) {
  return request({
    url: `/jcdSys/version/delete/${id}`,
    method: "DELETE",
    headers: encryptionData({}, `/version/delete/${id}`)
  });
}

/* 版本管理-获取修改信息 */
export function getVersionsDetail(data) {
  return request({
    url: "/jcdGys/getVersionsDetail",
    method: "get",
    headers: encryptionData(data, "/getVersionsDetail"),
    params: data
  });
}

/* 版本管理-修改 */
export function updateVersions(data) {
  return request({
    url: "/jcdGys/updateVersions",
    method: "post",
    headers: encryptionData(data, "/updateVersions"),
    data: Qs.stringify(data)
  });
}

/* 版本管理-添加 */
export function addVersions(data) {
  return request({
    url: "/jcdSys/version/save",
    method: "post",
    headers: encryptionData(data, "/version/save"),
    data: Qs.stringify(data)
  });
}

// // product-category

/* 产品类目-获取列表 */
export function getProductCategoryList(data) {
  return request({
    url: "/jcdGys/materialsCategory/page",
    method: "get",
    headers: encryptionData(data, "/materialsCategory/page"),
    params: data
  });
}

/* 产品类目-获取修改信息 */
export function getProductCategoryDetail(data) {
  return request({
    url: "/jcdGys/materialsCategory/getById",
    method: "get",
    headers: encryptionData(data, "/materialsCategory/getById"),
    params: data
  });
}

/* 产品类目-修改 */
export function updateProductCategory(data) {
  return request({
    url: "/jcdGys/materialsCategory/update",
    method: "post",
    headers: encryptionData(data, "/materialsCategory/update"),
    data: Qs.stringify(data)
  });
}

/* 产品类目-添加 */
export function addProductCategory(data) {
  return request({
    url: "/jcdGys/materialsCategory/save",
    method: "post",
    headers: encryptionData(data, "/materialsCategory/save"),
    data: Qs.stringify(data)
  });
}

/* 产品类目-删除 */
export function deleteProductCategory(data) {
  return request({
    url: "/jcdGys/materialsCategory/delete",
    method: "DELETE",
    headers: encryptionData(data, "/materialsCategory/delete"),
    data: Qs.stringify(data)
  });
}

/* 类型管理-获取列表 */
export function getTypeCategoryList(data) {
  return request({
    url: "/jcdGys/jcdAttrClassification/page",
    method: "get",
    headers: encryptionData(data, "/jcdAttrClassification/page"),
    params: data
  });
}

/* 类型管理-获取修改信息 */
export function getTypeCategoryDetail(id) {
  return request({
    url: `/jcdGys/jcdAttrClassification/get/${id}`,
    method: "get",
    headers: encryptionData({}, `/jcdAttrClassification/get/${id}`)
  });
}

/* 类型管理-修改 */
export function updateTypeCategory(data) {
  return request({
    url: "/jcdGys/jcdAttrClassification/update",
    method: "put",
    headers: encryptionData(data, "/jcdAttrClassification/update"),
    data: Qs.stringify(data)
  });
}

/* 类型管理-添加 */
export function addTypeCategory(data) {
  return request({
    url: "/jcdGys/jcdAttrClassification/save",
    method: "post",
    headers: encryptionData(data, "/jcdAttrClassification/save"),
    data: Qs.stringify(data)
  });
}

/* 类型管理-删除 */
export function deleteTypeCategory(data) {
  return request({
    url: "/jcdGys/jcdAttrClassification/delete",
    method: "DELETE",
    headers: encryptionData(data, "/jcdAttrClassification/delete"),
    data: Qs.stringify(data)
  });
}

/* 属性管理-获取列表 */
export function getAttrCategoryList(data) {
  return request({
    url: "/jcdGys/jcdAttrData/page",
    method: "get",
    headers: encryptionData(data, "/jcdAttrData/page"),
    params: data
  });
}

/* 属性管理-获取修改信息 */
export function getAttrCategoryDetail(data) {
  return request({
    url: "/jcdGys/jcdAttrData/get",
    method: "get",
    headers: encryptionData(data, "/jcdAttrData/get"),
    params: data
  });
}

/* 属性管理-修改 */
export function updateAttrCategory(data) {
  return request({
    url: "/jcdGys/jcdAttrData/update",
    method: "put",
    headers: encryptionData(data, "/jcdAttrData/update"),
    data: Qs.stringify(data)
  });
}

/* 属性管理-添加 */
export function addAttrCategory(data) {
  return request({
    url: "/jcdGys/jcdAttrData/save",
    method: "post",
    headers: encryptionData(data, "/jcdAttrData/save"),
    data: Qs.stringify(data)
  });
}

/* 属性管理-删除 */
export function deleteAttrCategory(data) {
  return request({
    url: "/jcdGys/jcdAttrData/delete",
    method: "DELETE",
    headers: encryptionData(data, "/jcdAttrData/delete"),
    data: Qs.stringify(data)
  });
}

// 平台设置-保存
export function zbbSysConfigSave(data) {
  return request({
    url: "/jcd-sys/zbbSysConfig/save",
    method: "post",
    headers: encryptionData(data, "/jcd-sys/zbbSysConfig/save"),
    params: data
  });
}

// 平台设置-详情
export function zbbSysConfigGetInfo() {
  return request({
    url: `/jcd-sys/zbbSysConfig/getInfo/1`,
    method: "get",
    headers: encryptionData({}, `/jcd-sys/zbbSysConfig/getInfo/1`),
    params: {}
  });
}
